#include "widget.h"
#include "ui_widget.h"
#include <fstream>
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    std::ifstream fin("D:\\C\\qt-practice\\QComboBox_2\\config.txt");
    if(!fin.is_open())
    {
        qDebug()<<"打开失败";
        return;
    }
    std::string line;
    while(std::getline(fin,line))
    {

        ui->comboBox->addItem(QString::fromStdString(line));
    }

}

Widget::~Widget()
{
    delete ui;
}

